//package com.example.administrator.managesystem.activity;
//import android.animation.Animator;
//import android.animation.AnimatorListenerAdapter;
//import android.animation.ObjectAnimator;
//import android.animation.ValueAnimator;
//import android.os.Handler;
//import android.support.v4.app.Fragment;
//import android.view.View;
//import android.view.ViewAnimationUtils;
//import android.view.ViewGroup;
//import android.widget.ImageView;
//import android.widget.LinearLayout;
//import android.widget.TextView;
//import android.widget.Toast;
//
//import com.example.administrator.managesystem.base.BaseActivity;
//import com.example.administrator.managesystem.R;
//import com.example.administrator.managesystem.fragment.firstpage.FirstPageFragment;
//import com.example.administrator.managesystem.fragment.firstpage.CircleFragment;
//import com.example.administrator.managesystem.fragment.firstpage.ManageFragment;
//import com.example.administrator.managesystem.fragment.DFragment;
//import com.next.easynavigation.utils.NavigationUtil;
//import com.next.easynavigation.view.EasyNavigationBar;
//
//import java.util.ArrayList;
//import java.util.List;
//
//public class ShareCircleActivity extends BaseActivity {
//    private EasyNavigationBar navigitionBar;
//    private LinearLayout menuLayout;
//    private String[] tabText = {"首页", "发现", "","消息", "我的"};
//    //未选中icon
//    private int[] normalIcon = {R.mipmap.index, R.mipmap.find,R.mipmap.add_image, R.mipmap.message, R.mipmap.me};
//    //选中时icon
//    private int[] selectIcon = {R.mipmap.index1, R.mipmap.find1,R.mipmap.add_image, R.mipmap.message1, R.mipmap.me1};
//    //仿微博图片和文字集合
//    private int[] menuIconItems = {R.mipmap.pic1, R.mipmap.pic2, R.mipmap.pic3};
//    private String[] menuTextItems = {"文字", "拍摄", "相册"};
//    private List<Fragment> fragments = new ArrayList<>();
//    private View cancelImageView;
//    private Handler mHandler = new Handler();
//
//
//    @Override
//    public void initView() {
//        navigitionBar = findViewById(R.id.navigitionBar);
//
//        fragments.add(new FirstPageFragment());
//        fragments.add(new CircleFragment());
//        fragments.add(new ManageFragment());
//        fragments.add(new DFragment());
//
//        navigitionBar.titleItems(tabText)
//                .normalIconItems(normalIcon)
//                .selectIconItems(selectIcon)
//                .fragmentList(fragments)
//                .fragmentManager(getSupportFragmentManager())
//                .onTabClickListener(new EasyNavigationBar.OnTabClickListener() {
//                    @Override
//                    public boolean onTabClickEvent(View view, int position) {
//                        if (position == 2) {
//                            //跳转页面（全民K歌）   或者   弹出菜单（微博）
//                            showMunu();
//                        }
//                        return false;
//                    }
//                })
//                .mode(EasyNavigationBar.MODE_ADD)
//                .build();
//
//
//
//    }
//
//    @Override
//    public void doBusiness() {
//        navigitionBar.setAddViewLayout(createWeiboView());
//    }
//
//    @Override
//    public int getLayoutId() {
//        return R.layout.activity_noadd;
//    }
//
//    //仿微博弹出菜单
//    private View createWeiboView() {
//        ViewGroup view = (ViewGroup) View.inflate(ShareCircleActivity.this, R.layout.layout_add_view, null);
//        menuLayout = view.findViewById(R.id.icon_group);
//        cancelImageView = view.findViewById(R.id.cancel_iv);
//        cancelImageView.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                closeAnimation();
//            }
//        });
//        for (int i = 0; i < 3; i++) {
//            View itemView = View.inflate(ShareCircleActivity.this, R.layout.item_icon, null);
//            ImageView menuImage = itemView.findViewById(R.id.menu_icon_iv);
//            TextView menuText = itemView.findViewById(R.id.menu_text_tv);
//
//            menuImage.setImageResource(menuIconItems[i]);
//            menuText.setText(menuTextItems[i]);
//            final int finalI = i;
//            menuImage.setOnClickListener(new View.OnClickListener() {
//                @Override
//                public void onClick(View v) {
//                    if( finalI ==0){
//                        Toast.makeText(ShareCircleActivity.this,"0",Toast.LENGTH_LONG).show();
//                    }
//                    if( finalI ==1){
//                        Toast.makeText(ShareCircleActivity.this,"1",Toast.LENGTH_LONG).show();
//                    }
//                }
//            });
//            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
//            params.weight = 1;
//            itemView.setLayoutParams(params);
//            itemView.setVisibility(View.GONE);
//            menuLayout.addView(itemView);
//
//        }
//        return view;
//    }
//
//    //
//    private void showMunu() {
//        startAnimation();
//        mHandler.post(new Runnable() {
//            @Override
//            public void run() {
//                //＋ 旋转动画
//                cancelImageView.animate().rotation(90).setDuration(400);
//            }
//        });
//        //菜单项弹出动画
//        for (int i = 0; i < menuLayout.getChildCount(); i++) {
//            final View child = menuLayout.getChildAt(i);
//            child.setVisibility(View.INVISIBLE);
//            mHandler.postDelayed(new Runnable() {
//
//                @Override
//                public void run() {
//                    child.setVisibility(View.VISIBLE);
//                    ValueAnimator fadeAnim = ObjectAnimator.ofFloat(child, "translationY", 600, 0);
//                    fadeAnim.setDuration(500);
//                    KickBackAnimator kickAnimator = new KickBackAnimator();
//                    kickAnimator.setDuration(500);
//                    fadeAnim.setEvaluator(kickAnimator);
//                    fadeAnim.start();
//                }
//            }, i * 50 + 100);
//        }
//    }
//
//
//    private void startAnimation() {
//        mHandler.post(new Runnable() {
//            @Override
//            public void run() {
//                try {
//                    //圆形扩展的动画
//                    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
//                        int x = NavigationUtil.getScreenWidth(ShareCircleActivity.this) / 2;
//                        int y = (int) (NavigationUtil.getScreenHeith(ShareCircleActivity.this) - NavigationUtil.dip2px(ShareCircleActivity.this, 25));
//                        Animator animator = ViewAnimationUtils.createCircularReveal(navigitionBar.getAddViewLayout(), x,
//                                y, 0, navigitionBar.getAddViewLayout().getHeight());
//                        animator.addListener(new AnimatorListenerAdapter() {
//                            @Override
//                            public void onAnimationStart(Animator animation) {
//                                navigitionBar.getAddViewLayout().setVisibility(View.VISIBLE);
//                            }
//
//                            @Override
//                            public void onAnimationEnd(Animator animation) {
//                                //							layout.setVisibility(View.VISIBLE);
//                            }
//                        });
//                        animator.setDuration(300);
//                        animator.start();
//                    }
//                } catch (Exception e) {
//                    e.printStackTrace();
//                }
//            }
//        });
//
//    }
//
//    /**
//     * 关闭window动画
//     */
//    private void closeAnimation() {
//        mHandler.post(new Runnable() {
//            @Override
//            public void run() {
//                cancelImageView.animate().rotation(0).setDuration(400);
//            }
//        });
//
//        try {
//            if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
//
//                int x = NavigationUtil.getScreenWidth(this) / 2;
//                int y = (NavigationUtil.getScreenHeith(this) - NavigationUtil.dip2px(this, 25));
//                Animator animator = ViewAnimationUtils.createCircularReveal(navigitionBar.getAddViewLayout(), x,
//                        y, navigitionBar.getAddViewLayout().getHeight(), 0);
//                animator.addListener(new AnimatorListenerAdapter() {
//                    @Override
//                    public void onAnimationStart(Animator animation) {
//                        //							layout.setVisibility(View.GONE);
//                    }
//
//                    @Override
//                    public void onAnimationEnd(Animator animation) {
//                        navigitionBar.getAddViewLayout().setVisibility(View.GONE);
//                        //dismiss();
//                    }
//                });
//                animator.setDuration(300);
//                animator.start();
//            }
//        } catch (Exception e) {
//        }
//    }
////    private Button mAdd,mDelete,mUpdate,mFind;
////    private TextView mContext;
////    private User mUser;
////    private UserDao mUserDao;
////    @Override
////    protected void onCreate(Bundle savedInstanceState) {
////        super.onCreate(savedInstanceState);
////        setContentView(R.layout.activity_type_in);
////        initView();
////        initEvent();
////        mUserDao = MyApplication.getInstances().getDaoSession().getUserDao();
////    }
////
////    private void initEvent() {
////        mAdd.setOnClickListener(this);
////        mDelete.setOnClickListener(this);
////        mUpdate.setOnClickListener(this);
////        mFind.setOnClickListener(this);
////    }
////
////    private void initView() {
////        mContext =  findViewById(R.id.textView);
////        mAdd =  findViewById(R.id.add);
////        mDelete = findViewById(R.id.delete);
////        mUpdate =  findViewById(R.id.change);
////        mFind = findViewById(R.id.find);
////    }
////
////    @Override
////    public void onClick(View v) {
////        switch (v.getId()) {
////            case R.id.add:
////                Map<String, String> params = ServiceManager.getInstance(this).getUrlParams();
////                ServiceManager.getInstance(this).getService(GuideAPI.class).initAPP(params)
////                        .subscribeOn(Schedulers.io())//IO线程加载数据
////                        .observeOn(AndroidSchedulers.mainThread())//主线程显示数据
////                        .subscribe(new Subscriber<ResponseBody>() {
////
////                            @Override
////                            public void onNext(ResponseBody responseBody) {
////                                try {
////                                    Log.e("msg",""+responseBody.string());
////                                } catch (IOException e) {
////                                    e.printStackTrace();
////                                }
////                            }
////
////
////                            @Override
////                            public void onCompleted() {
////
////                            }
////
////                            @Override
////                            public void onError(Throwable t) {
////
////                            }
////                        });
////
////
////                addDate();
////                break;
////            case R.id.delete:
////                deleteDate();
////                break;
////            case R.id.change:
////                updateDate();
////                break;
////            case R.id.find:
////                findDate();
////                break;
////        }
////    }
////
////    /**
////     * 增加数据
////     */
////    private void addDate() {
////        mUser = new User(null,"ethan");
////        mUserDao.insert(mUser);//添加一个
////        mContext.setText(mUser.getName());
////    }
////
////    /**
////     * 删除数据
////     */
////    private void deleteDate() {
////        deleteUserById(1);
////
////    }
////
////    /**
////     * 根据主键删除User
////     *
////     * @param id User的主键Id
////     */
////    public void deleteUserById(long id) {
////        mUserDao.deleteAll();
////    }
////
////    /**
////     * 更改数据
////     */
////    private void updateDate() {
////        mUser = new User((long)1,"eason");
////        mUserDao.update(mUser);
////    }
////
////    /**
////     * 查找数据
////     */
////    private void findDate() {
////        List<User> users = mUserDao.loadAll();
////        String userName = "";
////        for (int i = 0; i < users.size(); i++) {
////            userName += users.get(i).getName()+",";
////        }
////        mContext.setText("查询全部数据==>"+userName);
////    }
//}
